<div class='form'>
  <% form_for @order do |f| %>
    <%= f.error_messages %>


    <label for="order_address">送货地址</label><a href="/users/<%=session[:user_id]%>/addresses" >[管理]</a>
    <br />
    <% if @order_owen.addresses.size > 0 %>
      <div class="address">
        <% @order_owen.addresses.each do |a| %>
          <%=radio_button("order", "address_id",a.id)%><%=a.title%> <br />
        <% end %>
      </div>
    <%else%>
      <div class='break_line'></div>
      <%= render :partial =>'addresses/address'%>
      <div class='break_line'></div>
    <%end%>

    <p>
      <label for="order_paytype">支付方式</label>
      <%=select("order", "paytype",Order::PAYTYPE,:prompt => "请选择..")%>
    </p>
    <p>
      <label for="order_remark">附言</label>
      <%= f.text_area :remark,:rows=>'2' %>
    </p>

    <% if admin? && @order.id %>
      <p>
        <label for="order_status">订单状态</label>
        <%=select("order", "status",Order::STATUS,:prompt => "请选择..")%>
      </p>
      <p>
        <label for="order_shipping_remark">物流单号</label>
        <%= f.text_field :shipping_remark,:size=>'10' %>
      </p>

      <p>
        <label for="order_pay_remark">付款备注</label>
        <%= f.text_area :pay_remark,:rows=>'2' %>
      </p>
    <%end%>

    <p>
      <%= f.submit button_name,:class=>'submit' %>
    </p>
  <% end %>
</div>